import axios from './http'
import Qs from "qs";
// import Qs from 'qs'


const doc={
    test(params){
        // params = Qs.stringify(params)
        return axios.get('/api/markdown/test/', {params});
    },
    insertSpace(params){
        return axios.get('/api/markdown/insertSpace/', {params});
    },
    insertFile(params){
        return axios.get('/api/markdown/insertFile/', {params});
    },
    getSpaces(params){
        return axios.get('/api/markdown/getSpaces/', {params});
    },
    getFiles(params){
        return axios.get('/api/markdown/getFiles/', {params});
    },
    deleteFile(params){
        return axios.get('/api/markdown/deleteNode/', {params});
    },
    getContent(params){
        return axios.get('/api/markdown/getContent/', {params});
    },
    updateContent(params){
        return axios.post('/api/markdown/updateContent/', Qs.stringify(params),
            {headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
    },
    uploadImage(params){
        return axios.post('/api/markdown/uploadImg/', params,
            {headers: {'Content-Type': 'multipart/form-data'}});
    },
    exitEdit(params){
        return axios.get('/api/markdown/exitEdit/', {params});
    },

    downLoadFile(params){
        return axios.get('/api/downFile/', {params});
    },
    getFilePath(params){
        console.log(params)
        return axios.get('/api/markdown/getFilePath/', {params});
    },

    saveFile(params){
        return axios.get('/api/markdown/saveSheetData/', {params});
    },
    uploadExcelData(params){
        return axios.post('/api/markdown/uploadExcelData/', Qs.stringify(params),
            {headers: {'Content-Type': 'application/x-www-form-urlencoded'}})
        // return axios({
        //     url: '/markdown/uploadExcelData/',
        //     method: 'post',
        //     data: Qs.stringify(params),
        //     headers:{
        //         'Content-Type': 'application/x-www-form-urlencoded'
        //     }
        // })
    }
}
export default doc